package edu.java.ishop.services;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.beans.factory.annotation.Qualifier;

import edu.java.ishop.dao.ProductDao;
import edu.java.ishop.dao.impl.ProductFileDao;
import edu.java.ishop.model.Product;
@Named
public class ProductService {

	@Inject
	@Qualifier("database")
	private ProductDao dao;
	
	public ProductService() {	
		dao = new ProductFileDao();
	}
	
	public List<Product> getAll(){
		return dao.getAll();
	}
	
	public void save(Product product){
		dao.save(product);
	}
	public void setDao(ProductDao dao)
	{
		this.dao = dao;
	}

}
